package com.tungse.redisson;

import com.tungse.redisson.cfg.RedissonConfig;
import org.redisson.api.CronSchedule;
import org.redisson.api.RScheduledExecutorService;
import org.redisson.api.RedissonClient;

/**
 * @Author : Tungse
 * @Date: 2025/7/10 9:17
 * @Description:
 */
public class RSchedulerTest {
    public static void main(String[] args) {
        RedissonClient redisson = new RedissonConfig().redissonClient();
        RScheduledExecutorService scheduler = redisson.getExecutorService("myScheduler");
        scheduler.schedule(
                () -> System.out.println("定时任务执行"),
                CronSchedule.of("0/10 * * * * ?") // Cron表达式
        );
    }
}
